<!DOCTYPE html>
<html>
<head>
    <title>require.js: Child Error Catch Test</title>
    <script type="text/javascript" src="../../require.js"></script>
    <script type="text/javascript" src="../doh/runner.js"></script>
    <script type="text/javascript" src="../doh/_browserRunner.js"></script>
    <script type="text/javascript">
        var master = new doh.Deferred(),
            failed;

        function done() {
            if (failed) {
                master.callback(true);
            }
        }
        define('a', ['missing'], function(m) {
            return {};
        });

        require(['a'], function (a) {
            failed = false;
        }, function (err) {
            failed = true;
        });

        setTimeout(done, 500);

        doh.register(
            "errorChild",
            [
                {
                    name: "errorChild",
                    timeout: 1000,
                    runTest: function () {
                        return master;
                    }
                }
            ]
        );
        doh.run();
    </script>
</head>
<body>
    <h1>require.js: Child Error Catch Test</h1>
    <p>A top level require catches an error generated by a dependency.
        <a href="https://github.com/requirejs/requirejs/issues/1265">More info</a>.</p>
    <p>Check console for messages</p>
</body>
</html>
